/**
 * file
 */
package com.tdkj.action.front.member.financial;

import org.hibernate.Query;

import com.tdkj.action.BaseAction;
import com.tdkj.model.financial.BeanFinancialAccount;
import com.tdkj.model.financial.BeanConsumeRecord;
import com.tdkj.model.user.BeanUser;
import com.tdkj.util.Page;

/**
 * 
 * FileName: AccountManagementAction.java
 * 
 * @Description: TODO账户管理
 * 
 *               All rights Reserved, Designed By ZTE-ITS
 * 
 *               Copyright: Copyright(C) 2010-2011
 * 
 *               Company 天成科技有限公司
 * 
 * @author: 李兴建
 * 
 * @version V1.0
 * 
 *          Createdate: 2012-5-27 下午02:13:57
 * 
 * 
 * 
 *          Modification History:
 * 
 *          Date Author Version Discription
 * 
 * 
 * 
 * 
 * 
 *          
 *          ----------------------------------------------------------------------
 *          -------------
 * 
 *          2012-5-27 李兴建 1.0 1.0
 * 
 *          Why & What is modified: <修改原因描述>
 */
public class AccountAction extends BaseAction {
	private static final long serialVersionUID = 6693218627326781917L;
	private BeanFinancialAccount beanAccount;
	private BeanUser currUser;

	@Override
	public String execute() throws Exception {
		currUser = this.getCurrentUser();
		currUser = this.getBaseService().findById(currUser.getId(), BeanUser.class);
		beanAccount = currUser.getFinancialAccount();
		
		String hql = " from " + BeanConsumeRecord.class.getName() + " as bean where bean.user.id='"+currUser.getId()+"'";
		Query query = this.createQuery(hql);
		
		Page consumeRecords = this.getBaseService().findBy(query, 1, 10);
		this.getReturnInfo().put("consumeRecords", consumeRecords);
		
		return super.execute();
	}

	public BeanFinancialAccount getBeanAccount() {
		return beanAccount;
	}

	public void setBeanAccount(BeanFinancialAccount beanAccount) {
		this.beanAccount = beanAccount;
	}

	public BeanUser getCurrUser() {
		return currUser;
	}

	public void setCurrUser(BeanUser currUser) {
		this.currUser = currUser;
	}

}
